package com.meihua.code.leader.domain;

import java.io.Serializable;

/**
 * @program: code
 * @description:
 * @author: meihua
 * @created: 2021/08/10 18:11
 */
public class HttpResponse<T> implements Serializable {

    private int code;
    private T body;
    private int term;
    private int logIndex;


    public HttpResponse(int code, T body, int term, int logIndex) {
        this.code = code;
        this.body = body;
        this.term = term;
        this.logIndex = logIndex;
    }

    @Override
    public String toString() {
        return "HttpResponse{" +
                "code=" + code +
                ", body='" + body + '\'' +
                ", term=" + term +
                ", logIndex=" + logIndex +
                '}';
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public int getTerm() {
        return term;
    }

    public void setTerm(int term) {
        this.term = term;
    }

    public int getLogIndex() {
        return logIndex;
    }

    public void setLogIndex(int logIndex) {
        this.logIndex = logIndex;
    }
}
